/*
 * 布局参考的案例路由
 * @Description: jishupu-admin-template
 * @Author: 技术铺<jishupu@qq.com>
 * @Date: 2021-11-11
 */
import Layout from '@/views/layout'

const exampleRouter = {
  path: '/example',
  name: 'Example',
  redirect: 'noRedirect',
  meta: {
    title: '布局参考',
    icon: 'awesome-icon fab fa-artstation'
  },
  component: Layout,
  alwaysShow: true,
  children: [
    {
      name: 'TreeTable',
      path: 'tree-table',
      component: () => import('@/views/empty'),
      redirect: 'tree-table/index',
      meta: {
        title: '树形列表案例',
        icon: 'tree'
      },
      children: [{
        name: 'TreeTableIndex',
        path: 'index',
        component: () => import('@/views/example/tree-table/index'),
        hidden: true,
        meta: {
          title: '列表',
          activeMenu: '/example/tree-table'
        }
      }, {
        name: 'TreeTableCreate',
        path: 'create',
        component: () => import('@/views/example/tree-table/edit'),
        hidden: true,
        meta: {
          title: '添加',
          activeMenu: '/example/tree-table'
        }
      },
      {
        name: 'TreeTableEdit',
        path: ':id(\\d+)/edit',
        component: () => import('@/views/example/tree-table/edit'),
        hidden: true,
        meta: {
          title: '修改',
          activeMenu: '/example/tree-table'
        }
      }
      ]
    },
    {
      name: 'Table',
      path: 'table',
      component: () => import('@/views/empty'),
      redirect: 'table/index',
      meta: {
        title: '普通列表案例',
        icon: 'awesome-icon fas fa-list'
      },
      children: [{
        name: 'TableIndex',
        path: 'index',
        component: () => import('@/views/example/table/index'),
        hidden: true,
        meta: {
          title: '列表',
          activeMenu: '/example/table'
        }
      }, {
        name: 'TableCreate',
        path: 'create',
        component: () => import('@/views/example/table/edit'),
        hidden: true,
        meta: {
          title: '添加',
          activeMenu: '/example/table'
        }
      },
      {
        name: 'TableEdit',
        path: ':id(\\d+)/edit',
        component: () => import('@/views/example/table/edit'),
        hidden: true,
        meta: {
          title: '修改',
          activeMenu: '/example/table'
        }
      }
      ]
    },
    {
      path: 'icon',
      component: () => import('@/views/example/icons/index'),
      name: 'Icons',
      meta: {
        title: '图标',
        icon: 'awesome-icon fab fa-fonticons example-icons',
        noCache: true
      }
    },
    {
      path: 'nested',
      name: 'Nested',
      meta: {
        title: '路由嵌套',
        icon: 'nested'
      },
      component: () => import('@/views/example/nested/index'),
      children: [{
        path: 'menu1',
        component: () => import('@/views/example/nested/menu1/index'),
        name: 'Menu1',
        meta: {
          title: '菜单1'
        },
        children: [{
          path: 'menu1-1',
          component: () => import('@/views/example/nested/menu1/menu1-1'),
          name: 'Menu1-1',
          meta: {
            title: '菜单 1-1'
          }
        },
        {
          path: 'menu1-2',
          component: () => import('@/views/example/nested/menu1/menu1-2'),
          name: 'Menu1-2',
          meta: {
            title: '菜单 1-2'
          },
          children: [{
            path: 'menu1-2-1',
            component: () => import('@/views/example/nested/menu1/menu1-2/menu1-2-1'),
            name: 'Menu1-2-1',
            meta: {
              title: '菜单 1-2-1'
            }
          },
          {
            path: 'menu1-2-2',
            component: () => import('@/views/example/nested/menu1/menu1-2/menu1-2-2'),
            name: 'Menu1-2-2',
            meta: {
              title: '菜单 1-2-2'
            }
          }
          ]
        },
        {
          path: 'menu1-3',
          component: () => import('@/views/example/nested/menu1/menu1-3'),
          name: 'Menu1-3',
          meta: {
            title: '菜单 1-3'
          }
        }
        ]
      },
      {
        path: 'menu2',
        component: () => import('@/views/example/nested/menu2/index'),
        name: 'Menu2',
        meta: {
          title: '菜单 2'
        }
      }
      ]
    }
  ]
}

export default exampleRouter
